import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { ComponentsComponent } from '../components/components.component'
import { IndexComponent } from './index/index.component'
import { LoginComponent } from './sing/login/login.component'
import { Page404Component } from './sing/page404/page404.component'

export const routes = [
  { 
      path: '', component: ComponentsComponent,
      children: [
          { path: '', redirectTo: 'index', pathMatch: 'full'},
          { path: 'index', component: IndexComponent },
          { path: 'news', loadChildren: './news/news.module#NewsModule' },  
      ]
  },
  { path: 'login', component: LoginComponent },
  { path: 'page404', component: Page404Component },
  { path: '**', redirectTo: ''}
];